## FOR FIGURE 1 MANUSCRIPT: 

rm(list=ls())
setwd("~/Dropbox/Side projects/BET HOUSES PROJECT/data/Gambling_Replication_Materials/Data")
setwd("~/Dropbox/EUI/BET HOUSES PROJECT/data/Gambling_Replication_Materials/Estimates")

library(foreign)
library(haven)
library(ggmap)
library(ggplot2)
library(sp)
library(sf)
apuestas <- read_dta("apuestas_tipos_.dta")

figure1 <- ggplot(data = apuestas, aes(x=year_licence))+
  geom_histogram() + 
  ylab("Number of new betting houses/year") + 
  xlab("") + 
  ylim (0,11.2)+
  #geom_vline(xintercept = 2014, linetype = "dashed",color = "black",size = .5) +
  #geom_vline(xintercept = 2017, linetype = "dashed",color = "black",size = .5) +
  annotate("rect", xmin = 2014, xmax = 2017, ymin = 0, ymax = 11.2, 
           alpha = .3, color = "orange", fill = "orange") +
  theme(panel.background = element_rect(fill = "white", colour = "grey50"), 
        text=element_text(family="Times"),
        axis.title.x = element_text(size = 27), axis.title.y = element_text(size = 27), 
        axis.text.x = element_text(size = 18),axis.text.y = element_text(size = 18),
        axis.text = element_text(size = 20, color = "black"),
        axis.title = element_text(size = 20,color = "black"))
figure1
#ggsave("/Figures/histoyears_1203.png", plot = figure1, width = 30, height = 20, units = "cm")
